package com.iot.core.data.service;


import com.iot.core.data.entity.HtActionLog;
import com.iot.core.data.mapper.HtActionLogMapper;
import com.iot.core.manager.auth.HtDeptBaseDto;
import com.mybatisflex.core.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;



@Service
@Slf4j
public class HtActionLogService extends  ServiceImpl<HtActionLogMapper, HtActionLog> implements IHtActionLogService {

    @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor =Exception.class	)
    @Async
    @Override
    public void saveLogAsync(HtActionLog m)    {

        try {
            getMapper().insert(m);
        }
        catch(Exception ex){
            ex.printStackTrace();
            log.error(ex.getMessage() );
        }

    }

}
